
<div>
  <div class="pull-right">
    <%= link_to "新建百科", new_admin_wiki_path, class: "btn btn-primary" %>
  </div>

  <h1>
    百科(<%= @wikis.total_entries %>)
  </h1>
</div>

<div class="admin-wiki">
  <table class="table table-striped">
    <tr>
      <th>ID</th>
      <th>图片</th>
      <th>标题</th>
      <th>发布时间</th>
      <th></th>
    </tr>

    <% @wikis.each do |wiki| %>
      <tr>
        <td><%= wiki.id %></td>
        <td><a href="<%= wiki_path(wiki) %>" target="_blank"><div class="img"><%= wiki_small_img(wiki) %></div></a></td>
        <td><%= wiki.title %></td>
        <td><%= wiki.publish_time.to_s(:db) %></td>
        <td align="right">
          <%= link_to "编辑", edit_admin_wiki_path(wiki) %>
          &nbsp;&nbsp;
          |
          &nbsp;&nbsp;
          <% if wiki.deleted? %>
            已删
          <% else %>
            <%= link_to '删除',  admin_wiki_path(wiki), method: :delete, data: {confirm: "确认删除百科"} %>
          <% end %>
        </td>
      </tr>
    <% end -%>
  </table>

  <%= will_paginate @wikis %>
</div>
